package com.wk.worksetter.db

import androidx.room.*

/**
 * @author peng
 * @date 2021/1/28
 * 说明
 */

@Dao
interface WorkDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertWork(works:List<WorkEntity>)

    @Delete
    fun deleteWork(work:WorkEntity)

    @Update
    fun updateWork(work:WorkEntity)

    @Query("SELECT * FROM works WHERE running = :running ORDER BY updateTime")
    suspend fun getAllWorks(running:Boolean):List<WorkEntity>


}